﻿using System;

namespace FX.CC.Andon.Utility.Common
{
    /// <summary>
    /// //格式为 月-日-年转换成DateTime类型
    /// </summary>
    public class StringToDateTime
    {
        public static DateTime EnDateToCnDate(string date)
        {
            IFormatProvider cultureE = new System.Globalization.CultureInfo("en-us", true);
            DateTime dt = DateTime.Parse(date, cultureE, System.Globalization.DateTimeStyles.NoCurrentDateDefault);
            return Convert.ToDateTime(dt.ToString("yyyy-MM-dd"));
        }
        public static DateTime EnDateTimeToCnDateTime(string dateTime)
        {
            IFormatProvider cultureE = new System.Globalization.CultureInfo("en-us", true);
            DateTime dt = DateTime.Parse(dateTime, cultureE, System.Globalization.DateTimeStyles.NoCurrentDateDefault);
            return Convert.ToDateTime(dt.ToString("yyyy-MM-dd HH:mm"));
        }
    }
}
